Image encoding apparatus and control method of the same

ABSTRACT

An encoding apparatus includes a transformer which performs wavelet transform on image data to generate coefficients of subbands, and a predictive encoder which performs predictive coding on the coefficients. The predictive encoder includes a symbol generator which generates a symbol as an encoding target from a predictive error, an encoder which performs entropy coding on the generated symbol using a parameter determined in a process of encoding an immediately preceding coefficient of the coefficient of interest, an estimation unit which estimates a tentative symbol corresponding to a succeeding coefficient to be encoded next to the coefficient of interest, and a determination unit which determines a parameter for the succeeding coefficient from a code length obtained when assuming that the tentative symbol estimated by the estimation unit is obtained by encoding a parameter used when encoding the symbol of the coefficient of interest.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to an image data encoding technique.

Description of the Related Art

JPEG-LS is an image data encoding method. JPEG-LS can select losslesscoding and near-lossless coding. Also, JPEG-LS realizes a highcompression ratio by switching predictive coding and runlength codingbased on the states of surrounding pixels of an encoding target pixel.In predictive coding, the pixel value of an encoding target pixel ispredicted from surrounding pixels, and a predictive error is encoded byGolomb-Rice coding. There is also a known method by which afterGolomb-Rice coding is performed, whether the used encoding parameter isappropriate is evaluated, and an encoding parameter to be used next isdetermined (updated) (for example, Japanese Patent No. 4732203 to bereferred to as literature 1 hereinafter).

A coding method which uses a coding method such as JPEG-LS as acoefficient of wavelet transform is also available. A method ofdetermining an encoding parameter by using the correlation betweensubband components generated by wavelet transform and the correlationbetween surrounding wavelet coefficients is also known (for example,Japanese Patent No. 5218318 to be referred to as literature 2hereinafter).

Assume that a coefficient value obtained by converting the frequency ofimage data is input, the coefficient value of an encoding targetcoefficient is predicted from surrounding coefficients, and a predictiveerror is encoded by entropy coding. When determining an encodingparameter of a predictive error as an encoding target, the method ofliterature 1 evaluates the encoding parameter by using only the codelength of a most recently generated code. Therefore, the accuracy ofupdate becomes insufficient if state separation is not properlyperformed. The method of literature 2 requires a one-line coefficientbuffer for each subband component, and hence increases the memory cost.

SUMMARY OF THE INVENTION

The present invention has been made in consideration of the aboveproblem. According to an aspect of the invention, there is provided animage encoding apparatus for encoding image data, comprising: atransformer configured to perform wavelet transform on image data as anencoding target, thereby generating coefficients of a plurality ofsubbands; and a predictive encoder configured to perform predictivecoding on the coefficients in a raster scan order for each of thesubbands obtained by the transformer, wherein the predictive encodercomprises: a symbol generator configured to obtain a predictive valuecorresponding to a coefficient of interest in a subband of interest froma coefficient in a completely encoded position around the coefficient ofinterest, and generate a symbol as an encoding target from a predictiveerror as a difference between a value of the coefficient of interest andthe predictive value; an encoder configured to perform entropy coding onthe generated symbol by using a parameter determined in a process ofencoding an immediately preceding coefficient of the coefficient ofinterest; an estimation unit configured to estimate a tentative symbolcorresponding to a succeeding coefficient to be encoded next to thecoefficient of interest, based on a symbol corresponding to thecoefficient of interest; and a determination unit configured todetermine a parameter for the succeeding coefficient from a code lengthobtained when assuming that the tentative symbol estimated by theestimation unit is obtained by encoding a parameter used when encodingthe symbol of the coefficient of interest.

The present invention makes it possible to execute an efficient imageencoding process while suppressing the memory cost.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments (with reference to theattached drawings).

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a view showing an example of the arrangement of an imageencoding apparatus;

FIG. 2 is a view showing an example of the arrangement of an encoder ofthe first embodiment;

FIG. 3 is a view showing the hardware configuration of an informationprocessing unit;

FIGS. 4A and 4B are views showing an example of the arrangement of animaging unit of a camera;

FIG. 5 is a flowchart of processing performed by the encoder of thefirst embodiment;

FIG. 6 is a dataflow diagram in a predictive encoder of the firstembodiment;

FIGS. 7A and 7B are views for explaining the concept of subband divisionby wavelet transform, and an example of a code to be generated;

FIG. 8 is a view showing the positional relationship between acoefficient of interest and reference coefficients;

FIG. 9 is a view for explaining the number of coefficients necessary fora prediction process of the first embodiment;

FIGS. 10A and 10B are views for explaining Golomb-Rice coding;

FIG. 11 is a view showing the positional relationship between waveletcoefficients, symbols, and K parameters;

FIG. 12 is a flowchart showing details of a K parameter updating processof the first embodiment;

FIG. 13 is a view for explaining the number of necessary K parameters ofthe K parameter updating process of the first embodiment;

FIG. 14 is a view for explaining the number of coefficients required fora prediction process of the second embodiment; and

FIG. 15 is a view showing an example of the arrangement of an encoder ofthe third embodiment.

DESCRIPTION OF THE EMBODIMENTS

Preferred embodiments of the present invention will be explained belowwith reference to the accompanying drawings. Note that each of theembodiments to be explained below shows an example when the presentinvention is practically carried out, and is a practical embodiment ofan arrangement described in the scope of claims.

[First Embodiment]

The first embodiment is applied to an image encoding apparatus whichdivides image data into a plurality of subbands by wavelet transform,and encodes wavelet coefficients divided into the subbands by predictivecoding. The image encoding apparatus according to the first embodimentwill be explained below.

FIG. 1 is a block diagram when the image encoding apparatus of the firstembodiment is applied to a camera 100. The camera 100 includes anoperation unit 101, imaging unit 102, information processing unit 109,storing unit 107, and I/O interface 108.

FIG. 4A is a view showing the outer appearance (the front part) of thecamera 100. As shown in FIG. 4A, the camera 100 includes the imagingunit 102. FIG. 4B is a view showing the internal arrangement of theimaging unit 102. The imaging unit 102 includes a zoom lens 401,focusing lenses 402 and 403, an aperture stop 404, and a shutter 405.The imaging unit 102 also includes an optical low-pass filter 406, iRcut filter 407, color filter 408, imaging device 409, and A/D converter410. The user can control an incident light amount to be input to theimaging unit 102 by adjusting the stop 404. The imaging device 409 is alight-receiving device such as a CMOS or CCD. When the imaging device409 detects the light amount of an object, the A/D converter 410converts the detected light amount into a digital value. This digitalvalue (digital data) is supplied to the information processing unit 109.

FIG. 3 is a view showing the internal arrangement of the informationprocessing unit 109. The information processing unit 109 includes a CPU301, RAM 302, and ROM 303. A system bus 304 connects these components toeach other.

The CPU 301 is a processor for comprehensively controlling theindividual units in the camera 100. The RAM 302 functions as a mainmemory, work area, and the like of the CPU 301. The ROM 303 storesprograms for executing the individual components of the informationprocessing unit 109 shown in FIG. 1. When the CPU 301 reads out andexecutes the programs stored in the ROM 303, the information processingunit 109 implements the roles of respective corresponding componentsshown in FIG. 1. Note that the information processing unit 109 may alsoinclude, for example, a dedicated processing circuit which functions aseach component shown in FIG. 1, in place of the above arrangement.

The operation unit 101 includes input devices such as a button, dial,and touch panel of the camera body. The user can input instructions suchas the start and stop of imaging and the setting of imaging conditionsby operating the operation unit 101. The storing unit 107 is anonvolatile storage medium such as a memory card capable of storing RAWimage data acquired by the imaging unit 102 and image data. The I/Ointerface 108 can use serial bus connection implemented by a universalserial bus (USB), and has a corresponding USB connector. It is, ofcourse, also possible to use, for example, LAN connection by an opticalfiber, or wireless connection. A display unit 305 displays images andcharacters. A liquid crystal display is generally used as the displayunit 305. The display unit 305 may also have a touch panel function. Inthis case, user instructions using the touch panel can be processed asinputs to the operation unit 101.

The processing of the information processing unit 109 of this embodimentwill be explained in more detail below. First, an acquisition unit 103acquires RAW image data output from the imaging unit 102, and suppliesthe RAW image data to an image processing unit 104. The image processingunit 104 receives the RAW image data, generates image data byde-mosaicking the input data, and outputs the image data to an encoder105.

The encoder 105 performs entropy coding on the image data. Thisembodiment will be explained by taking, as an example, a case in whichone pixel is expressed by eight bits of each of R, G, and B, and data isencoded as a monochrome image for each color component. That is, theencoder 105 independently encodes an R-component monochrome multilevelimage, G-component monochrome multilevel image, and B-componentmonochrome multilevel image. Note that image data as an encoding targetis not limited to RGB image data, and may also be image data usinganother color space or RAW image data. For example, when one pixel isformed by eight bits of each of Y, Cb, and Cr, this image data can beencoded as a monochrome image for each color component. Also, when thisembodiment is applied to RAW image data, the imaging device of theimaging unit 102 has a Bayer array (an array including sets of 2×2imaging devices corresponding to the colors of R, G0, G1, and B). Assumealso that a signal from each imaging device is expressed by 14 bits. Inthis case, the encoder 105 encodes an R-component monochrome multilevelimage, G0-component monochrome multilevel image, G1-component monochromemultilevel image, and B-component monochrome multilevel image.Accordingly, this application is not restricted by the type of colorspace of an image, the types of color components forming an image, andthe number of bits. Note that it is assumed that an image as an encodingtarget is formed by eight bits (256 gray levels) of each of the threecomponents R, G, and B in order to facilitate understanding byexhibiting a practical example.

The processing of the encoder 105 according to this embodiment will beexplained. FIG. 2 shows the internal arrangement of the encoder 105.FIG. 5 is a flowchart showing an encoding process to be performed by theencoder 105 on image data of one color component (in this embodiment,one of R, G, and B). That is, this process shown in FIG. 5 ispractically executed three times. One file is formed by collectingencoded data obtained by executing the process three times.

An image input unit 201 receives image data of one color component asmonochrome multilevel image data from image data output from the imageprocessing unit 104 (step S501).

A wavelet transformer 202 receives the monochrome multilevel image datafrom the image input unit 201, and performs wavelet transform a presetnumber of times. As a consequence, the image data is divided into aplurality of decomposition levels. Each decomposition level includes aplurality of subbands. The decomposition level indicates the number oftimes of division when a low-frequency-component subband (LL) isrecursively divided into two in the horizontal and vertical directions.When the number of decomposition levels increases by 1, the horizontaland vertical resolutions reduce by half.

FIG. 7A explains an example in which wavelet transform is executed threetimes. LL1, HL1, LH1, and HH1 represent the subbands of decompositionlevel 1, LL2, HL2, LH2, and HH2 represent the subbands of decompositionlevel 2, and LL3, HL3, LH3, and HH3 represent the subbands ofdecomposition level 3. Note that a transform target of wavelet transformfrom the second time is subband LL obtained by immediately precedingwavelet transform, so subbands LL1 and LL2 are omitted, and subband LLobtained by last wavelet transform remains. Also, the horizontal andvertical resolutions of, for example, HL2 are half those of HL1. SubbandLH indicates a horizontal-direction frequency characteristic (ahorizontal-direction component) of a local region to which wavelettransform is applied. Likewise, subband HL indicates avertical-direction frequency characteristic (a vertical-directioncomponent), and subband HH indicates an oblique-direction frequencycharacteristic (an oblique-direction component). Subband LL is alow-frequency component. An integer-type 5/3 filter is used in wavelettransform of this embodiment, but the present invention is not limitedto this. It is also possible to use another wavelet transform filtersuch as a real-type 9/7 filter used in JPEG2000 (ISO/IEC15444|ITU-TT.800) as an international standard. In addition, the processing unit ofwavelet transform can be either a line or image.

The wavelet transformer 202 outputs the wavelet coefficient of eachwavelet-transformed subband to a predictive encoder 203 (step S502). Thepredictive encoder 203 predictively encodes the wavelet coefficient ofeach subband. Details of the predictive transformer 203 will bedescribed later.

In step S503, the predictive encoder 203 sets a variable i indicatingthe number of times of decomposition in wavelet transform. In thisembodiment, an example in which i=3 is set will be explained. Note thatthe user can suitably change the number of times of wavelet transformfrom the operation unit 101. Note also that in the flowchart of FIG. 5,subbands LL(i), HL(i), LH(i), and HH(i) are generalized by using thevariable i. For example, HL(3) indicates the same subband as that of HL3shown in FIG. 9.

In step S504, the predictive encoder 203 executes a process ofpredictively encoding subband LL3. The predictive encoder 203 storesencoded data obtained by this encoding process in a buffer areapre-allocated in the RAM 302.

In step S505, the predictive encoder 203 determines whether the variablei is 0. Assume that the state in this step is an initial stage, that is,=3. Accordingly, the process advances to step S506.

In step S506, the predictive encoder 203 executes a process ofpredictively encoding subband HL(3). The predictive encoder 203 storesencoded data obtained by this encoding process in the buffer areapre-allocated in the RAM 302. In step S507, the predictive encoder 203executes a process of predictively encoding subband LH(3). Thepredictive encoder 203 stores encoded data obtained by this encodingprocess in the buffer area pre-allocated in the RAM 302. In step S508,the predictive encoder 203 executes a process of predictively encodingsubband HH(3). The predictive encoder 203 stores encoded data obtainedby this encoding process in the buffer area pre-allocated in the RAM302.

After that, the predictive encoder 203 reduces the variable i by 1 instep S509. This results in variable i=2. Then, the predictive encoder203 returns the process to step S505. Subsequently, the predictiveencoder 203 performs the above process until it is determined in stepS505 that variable i=0.

If it is determined that variable i=0, the encoded data of a total often subbands LL(3), HL(3), LH(3), HH(3), HL(2), . . . , HH(1) are storedin the buffer area of the RAM 302. Therefore, a code output unit 204generates encoded data of monochrome multilevel image data of a colorcomponent of interest by integrating these subband encoded data, andoutputs the generated data (step S510).

The foregoing is the encoding process for one color component. Asdescribed previously, however, this embodiment performs encoding foreach of color components R, G, and B. Therefore, the encoder 105executes the process shown in FIG. 7 three times. Referring to FIG. 1again, the encoder 105 supplies the encoded data of all the colorcomponents to an output unit 106. The output unit 106 forms an imagefile by adding an appropriate header to the supplied encoded data of theindividual components, and outputs the image file as a compressed imagedata file to the storing unit 107 where the compressed image data fileis saved. FIG. 7B shows an example of the data structure of thecompressed image data file. The header shown in FIG. 7B containsinformation necessary for decoding, for example, the size (the number ofhorizontal-direction pixels and the number of vertical-direction pixels)of the image data as an encoding target, the number of times of wavelettransform, the name of a color space, and the number of bits of a colorcomponent.

The overall procedures when dividing image data into subbands by wavelettransform and predictively encoding each subband have been explainedabove. Next, details of the predictive encoder 203 for predictivelyencoding the wavelet coefficient of each subband in a raster scan orderwill be explained.

FIG. 6 shows a dataflow diagram of the predictive encoder 203 accordingto the first embodiment. Note that various buffers shown in FIG. 6 areallocated in the RAM 302.

First, the wavelet coefficients obtained by the wavelet transformer 202are stored in the raster scan order in a wavelet coefficient storagebuffer 601 (allocated in the RAM 302) for each subband. Subbandattribute information is also stored in the wavelet coefficient storagebuffer 601. “The subband attribute information” contains the subbandwidth, the subband height, and information indicating whether thesubband is LL, HL, LH, or HH.

A wavelet coefficient information buffer 602 holds wavelet coefficientinformation necessary for predictive coding, which is read out from thewavelet coefficient storage buffer 601. The wavelet coefficientinformation buffer 602 is desirably implemented by a high-speed memorysuch as an SRAM because accesses frequently occur during encoding. Thewavelet coefficient information held in the wavelet coefficientinformation buffer 602 contains wavelet coefficients necessary forprocesses 603, 604, and 606 and the above-described subband attributeinformation. Note that “the necessary wavelet coefficients” will bedescribed in the next paragraph. Note also that the bit range of thewavelet coefficient depends on the bit range of an input image, thenumber of times of wavelet transform, and the type of wavelet filter.For example, when a 14-bit input image is wavelet-transformed threetimes by using an integer-type 5/3 filter, the bit range of thegenerated wavelet coefficient is 20 bits.

The prediction process 603 is a process of predicting the value of awavelet coefficient of interest. In this embodiment, the predictionprocess is performed based on the wavelet coefficient stored in thewavelet coefficient information buffer 602, and the subband attributeinformation. The prediction process 603 will be explained in detailbelow.

First, the predictive encoder 203 identifies whether the waveletcoefficient of interest as an encoding target belongs to subband LL, HL,LH, or HH from the subband attribute information.

Then, the predictive encoder 203 performs prediction corresponding tothe subband. This prediction is performed by referring to waveletcoefficients (to be referred to as reference coefficients hereinafter)existing in already encoded positions around the wavelet coefficient ofinterest (to be referred to as a coefficient of interest hereinafter) asan encoding target. FIG. 8 shows the positional relationship between thecoefficient of interest and reference coefficients in order to explainprediction in each subband. In FIG. 8, reference symbol x denotes thecoefficient of interest, and reference symbols a, b, c, and d denote thereference coefficients. Since it is assumed that processing is performedin the raster scan order in the first embodiment, the referencecoefficients a, b, c, and d exist in the already encoded positions. Notethat the coefficients b and d do not exist if the coefficient x ofinterest is positioned in the first line of a given subband. Especiallywhen the coefficient x of interest is positioned at the left end of thefirst line of a given subband, none of the coefficients a to d exist.Furthermore, when the coefficient x of interest is positioned at theleft end of the second or subsequent line of a given subband, thecoefficients a and c do not exist. Non-existing coefficients like theseare each regarded as having a predetermined value. This predeterminedvalue is not particularly limited as long as the value is common to theencoding side and decoding side. Assume that the predetermined value is0 in this embodiment. A method of predicting each subband will bedescribed below.

When the subband of interest currently being encoded is LL, thepredictive encoder 203 obtains a predictive value p of the coefficientby using MED (Median Edge Detection) prediction, thereby performingpredictive coding. An expression for calculating the predictive value pby using the reference coefficients shown in FIG. 8 is as follows:

$p = \left\{ \begin{matrix}{{\max\left( {a,b} \right)}\mspace{14mu}} & {{{if}\mspace{14mu} c} \leq {\min\left( {a,b} \right)}} \\{{\min\left( {a,b} \right)}\mspace{14mu}} & {{{if}\mspace{14mu} c} \geq {\max\left( {a,b} \right)}} \\{{a + b - c}\mspace{14mu}} & {otherwise}\end{matrix} \right.$

When the subband currently being processed is HL, the predictive encoder203 uses vertical prediction. Since subband HL has a vertical frequencycharacteristic, vertical prediction is effective to improve the encodingefficiency. An expression for calculating the predictive value p byusing the coefficients shown in FIG. 8 is as follows:p=b

When the subband currently being processed is LH, the predictive encoder203 performs horizontal prediction. Since subband LH has a horizontalfrequency characteristic, horizontal prediction is effective to improvethe encoding efficiency. An expression for calculating the predictivevalue p by using the coefficients shown in FIG. 8 is as follows:p=a

When the subband currently being processed is HH, the predictive encoder203 performs no prediction and uses a fixed value. A practicalpredictive value p is as follows:p=0

By the above processing, the predictive encoder 203 outputs thepredictive value p corresponding to the subband to which the waveletcoefficient of interest as an encoding target belongs. When performingthe prediction process as described above, the range of necessaryreference coefficients changes. The wavelet coefficient informationbuffer 602 is desirably designed based on the reference coefficientrange in this prediction process. For example, the referencecoefficients a, b, and c are used in the prediction process whenencoding the wavelet coefficient of subband LL. Of the referencecoefficients a, b, and c, the reference coefficient c is farthest fromthe wavelet coefficient x of interest in the array. To refer tocoefficients positioned in the coefficient c, it is necessary to holdwavelet coefficients by a number represented by subband width+1. Thissimilarly applies to subbands LH, HL, and HH: the number of waveletcoefficients to be held can be obtained from reference coefficients tobe used in prediction. FIG. 9 shows the relationship between referencecoefficients to be used in the prediction process of each subband andthe number of wavelet coefficients to be held in order to realize thereference.

The predictive encoder 203 then performs the predictive error-symbolgenerating process 604. In this process, the predictive encoder 203receives the predictive value p obtained in the prediction process 603,and the wavelet coefficient x of interest from the wavelet coefficientinformation buffer 602. Subsequently, the predictive encoder 203 obtainsa predictive error Diff from the predictive value p and coefficient x ofinterest, and generates a symbol to be practically encoded. Therelationship between the predictive error Diff, coefficient x ofinterest, and predictive value p is as follows:Diff=x−p

Then, the predictive encoder 203 converts the predictive error Diff intoa non-negative integral value based on the following expression, anddetermines this value as a symbol S to be encoded:

$S = \left\{ \begin{matrix}{2 \times {Diff}} & {{{if}\mspace{14mu}{Diff}} \geq 0} \\{{{- 2} \times {Diff}} - 1} & {otherwise}\end{matrix} \right.$

Consequently, the symbol S is obtained as a non-negative integer, and itis possible to identify the predictive error Diff and whether its signis plus or minus sign based on whether the symbol S is an even or oddnumber.

Subsequently, the predictive encoder 203 performs a Golomb-Rice encodingprocess 605 on the symbol S output from the predictive error-symbolgenerating process 604 by using a K parameter read out from a Kparameter buffer 607. Note that both the symbol S and K parameter arenon-negative integers. Note also that the K parameter updating process606 as a process of updating the K parameter buffer 607 will bedescribed later.

The procedure of Golomb-Rice coding is as follows.

Step 1: 0s equal to a number indicated by a value obtained by shiftingthe symbol S (binary expression) to the right by K bits are arranged,and binary data is generated by adding 1 after these 0s.

Step 2: Lower K bits of the symbol S are extracted and added after thebinary data generated in step 1.

FIG. 10A shows the relationship between the K parameter, the symbol S,and a codeword (binary notation) of Golomb-Rice coding. FIG. 10Ademonstrates that when the symbol S is 3 and K=1, for example, acodeword to be generated by Golomb-Rice coding is “011” by binarynotation. However, Golomb-Rice coding is not limited to this, and it isalso possible to form a code by switching 0 and 1, or by switching steps1 and 2 described in the aforementioned procedure.

FIG. 10B shows the relationship between the K parameter, the symbol S,and the code length (the number of bits) of a codeword to be generated.For example, the codeword is “011” when the symbol S is 3 and the Kparameter is 1 as described above, so the code length is “3 (bits)”. Asshown in FIG. 10B, the code length (the number of bits) of a codeword tobe generated by the K parameter changes when the symbol S is fixed. Whensymbol S=6, for example, a minimum code length of 4 is obtained when theK parameter is 2 or 3. The code length increases when the K parameter is1 or less or 4 or more. That is, a K parameter range within which thecodeword has the minimum code length exists, and no minimum code lengthis obtained if a K parameter smaller or larger than this range is used.This similarly applies to symbols other than 6, although there is thecondition that the K parameter is a non-negative integer. Note thathatched portions in FIG. 10B indicate regions where no minimum codelength is obtained. To achieve a high encoding efficiency, therefore, itis necessary to appropriately determine the K parameter. The K parameterupdating process 606 is a process of determining the K parameter, anddetails of this process will be described below.

The basic processing of the K parameter updating process 606 of thepredictive encoder 203 is to update the K parameter used in theGolomb-Rice encoding process 605 for the coefficient x of interest, inorder to use the K parameter in Golomb-Rice coding of a coefficient tobe encoded next. The K parameter updating process 606 is performed byreceiving the wavelet coefficients and subband attribute informationfrom the wavelet coefficient information buffer 602, the symbol S fromthe predictive error-symbol generating process 604, and the past Kparameters to be referred to from the K parameter buffer 607.

The K parameter for the symbol S has an optimum value by which the codelength is minimum as described previously, but a symbol as a nextencoding target is unknown. Therefore, the gist of the K parameterupdating process 606 is to predict a symbol as the next encoding target,and determine a K parameter suitable for the symbol.

To explain this process, FIG. 11 shows the positional relationshipbetween the wavelet coefficients, symbols, and K parameters to be usedin the process.

Referring to FIG. 11, a to d, x, and n denote wavelet coefficients. Thewavelet transform coefficient x is a most recently encoded waveletcoefficient. The wavelet transform coefficients a, b, c, and d areencoded coefficients around the wavelet transform coefficient x. Thewavelet transform coefficient n indicates a coefficient as a nextencoding target, and is unknown immediately after encoding of thecoefficient x is complete. Note that the layout of the wavelet transformcoefficients a, b, c, d, and x is the same as that shown in FIG. 8, butthe wavelet transform coefficient x shown in FIG. 11 is a coefficient ofinterest having undergone the encoding process.

Sx, Sd, and Sn in FIG. 11 denote symbols corresponding to the waveletcoefficients. The symbol Sx is a symbol corresponding to the mostrecently encoded wavelet coefficient x, and is an actually encodedsymbol S received from the symbol generating process 604. The symbol Snis a symbol of the coefficient n as a next encoding target, and is alsoa target to be predicted in this process. The symbol Sd is a symbol usedwhen encoding the wavelet coefficient d.

Kx, Kd, and Kn in FIG. 11 denote K parameters corresponding to thewavelet coefficients. Kx is a K parameter corresponding to the mostrecently encoded wavelet coefficient x. Kn is an objective variable ofthis process, and is a K parameter to be used in Golomb-Rice coding whenencoding the coefficient n for the next time. Kd is a K parameter usedwhen performing Golomb-Rice coding on the wavelet coefficient d.

Based on the above description, a process of determining the K parameterKn to be used in next encoding in the predictive encoder 203 whenencoding of the coefficient x of interest is complete will be explainedwith reference to a flowchart shown in FIG. 12.

First, in step S1201, the predictive encoder 203 identifies, from thesubband attribute information, whether the wavelet transform coefficientx of interest belongs to subband LL currently being encoded. If it isdetermined that a wavelet transform coefficient belonging to subband LLis currently being processed, the process advances to step S1202. Ifnot, that is, if it is determined that subband LH, HL, or HH iscurrently being processed, the process advances to step S1205.

In step S1202, the predictive encoder 203 calculates the symbol Sd. Thesymbol Sd corresponds to the position of the already encoded wavelettransform coefficient d, and can also be implemented by holding thesymbol itself of one line in a buffer. However, this increases thememory cost. Therefore, the predictive encoder 203 of this embodimentcalculates the symbol Sd without buffering it. To calculate the symbolSd, the predictive encoder 203 first obtains the predictive value p ofthe wavelet transform coefficient d. Since the subband as a processingtarget in step S1202 is LL, the original prediction method is MED asdescribed earlier. However, if MED is performed at the position of thecoefficient d, another one-line wavelet coefficient buffer is necessary.To prevent this, this embodiment obtains the predictive value p of thecoefficient d in a pseudo manner by:p=bWhen the predictive value p of the wavelet transform coefficient d isobtained, the predictive encoder 203 obtains the symbol Sd by the samemethod as that of the predictive error-symbol generating process 604.When the symbol Sd is obtained, the process advances to step S1203.

In step S1203, the predictive encoder 203 predicts the symbol Sn (asymbol estimating process). In this stage, the coefficient n to beencoded next is unknown, but the symbol Sn corresponding to the unknowncoefficient n is predicted as a mean value of the symbol Sx determinedby latest encoding and the symbol Sd positioned above the symbol Sn.Accordingly, the predictive symbol Sn is obtained by:Sn=(Sx+Sd)/2

When the predictive symbol Sn is thus obtained, the process advances tostep S1204. In step S1204, the predictive encoder 203 calculates the Kparameter “Kn” to be used in next encoding, based on the predictivesymbol Sn.

In this embodiment, the K parameter “Kn” to be used in next encoding isdetermined in accordance with a code length derived when performingGolomb-Rice coding on the predictive symbol Sn by the K parameter “Kx”used when encoding the wavelet transform coefficient x. This process isthe same as the method of literature 1. A practical example of stepS1204 will be explained below.

As shown in FIG. 10B, a K parameter range within which the code lengthof a codeword obtained when performing Golomb-Rice coding on the symbolS is minimum exists. Let Kmin(S) be the lower limit of the K parameterrange within which the minimum code length is obtained, and Kmax(S) bethe upper limit thereof. For example, when the symbol S is “2” and the Kparameter is 0 to 2, the codeword has a minimum code length of “3”, soKmin(2)=0, and Kmax(2)=2. Likewise, when the symbol S is “4”, Kmin(4)=1,and Kmax(4)=3. These values of S, Kmin(S), and Kmax(S) are prepared as atable in a memory or the like.

As described above, the lower limit of the K parameter range withinwhich the codeword corresponding to the predictive symbol Sn has aminimum code length can be represented by Kmin(Sn), and the upper limitthereof can be represented by Kmax(Sn).

(1) When Kx<Kmin(Sn)

The predictive encoder 203 estimates that if a symbol as a next encodingtarget is encoded by using Kx, it is highly likely that Kx becomessmaller than the lower limit of the range within which the minimum codelength is obtained. Accordingly, the predictive encoder 203 obtains theK parameter “Kn” to be used in next encoding by increasing Kx by apredetermined value. More specifically, Kn is obtained by:Kn=Kx+1(2) When Kmin(Sn)≤Kx≤Kmax(Sn)

The predictive encoder 203 estimates that if a symbol as a next encodingtarget is encoded by using Kx, it is highly likely that Kx falls withinthe range within which the codeword has the minimum code length.Accordingly, the predictive encoder 203 determines that the K parameter“Kx” used when encoding the latest coefficient x can be used as the Kparameter “Kn” to be used in next encoding.

(3) When Kmax(Sn)<Kx

The predictive encoder 203 estimates that if a symbol as a next encodingtarget is encoded by using Kx, it is highly likely that Kx becomeslarger than the upper limit of the range within which the minimum codelength is obtained. Accordingly, the predictive encoder 203 obtains theK parameter “Kn” to be used in next encoding by decreasing Kx by apredetermined value. More specifically, Kn is obtained by:Kn=Kx−1

After determining Kn as described above, the predictive encoder 203updates the K parameter buffer 607 so as to hold Kn as a K parameter tobe used in next Golomb-Rice coding and delete an unnecessary Kparameter, and terminates the process. As a consequence, the K parameter(above-mentioned Kn) held in the K parameter buffer 607 is used whenencoding the next coefficient n.

On the other hand, if the wavelet transform coefficient x of interestbelongs to subband LH, HL, or HH other than subband LL, the predictiveencoder 203 advances the process to step S1205.

In step S1205, the predictive encoder 203 predicts the symbol Sn. Unlikestep S1203, step S1205 is a step of predicting Sn of a subband (HL, LH,or HH) other than subband LL. Sd cannot be calculated in a subband otherthan subband LL. This is so because the wavelet coefficient informationbuffer 602 does not hold any buffer for a coefficient in the position ofd in subbands LH and HH. Also, in subband HL, the prediction method isvertical, so another one-line wavelet coefficient buffer is required tocalculate Sd. In this process, therefore, the predictive encoder 203predicts the symbol Sn by:Sn=Sx

That is, the predictive encoder 203 estimates that the symbol Sx whenencoding the coefficient x of interest is equal to the symbol of theunknown wavelet transform coefficient n.

After obtaining the predictive symbol Sn, the predictive encoder 203advances the process to step S1206. In step S1206, the predictiveencoder 203 calculates Kn by the predictive symbol Sn. This process isthe same as the method in step S1204 explained previously, so anexplanation thereof will be omitted.

Then, in step S1207, the predictive encoder 203 corrects Kn by Kd. Asdescribed in the explanation of step S1205, Sn cannot be predicted byusing Sd in subbands HL, LH, and HH unlike in subband LL. Accordingly,the accuracy of Kn is lower than that in subband LL. To compensate forthis, this process corrects Kn by referring to Kd. In this embodiment,Kn is corrected based on:

${Kn} = \left\{ \begin{matrix}{{Kn} + 1} & {{{if}\mspace{14mu}\left( {{Kd} - {Kn}} \right)} > 1} \\{Kn} & {otherwise}\end{matrix} \right.$

After correcting Kn, the predictive encoder 203 updates the K parameterbuffer 607 so as to hold Kn as a K parameter to be used in nextGolomb-Rice coding and delete an unnecessary K parameter, and terminatesthe process.

The abovementioned processing makes it possible to determine Kn byreferring not only to the latest encoding conditions (the symbol Sx andK parameter Kx) but also to the surrounding encoding condition (thesymbol Sd or K parameter Kd) in the encoding process of any subbandcoefficient. Consequently, the encoding efficiency can be increased.

Referring to FIG. 6 again, the K parameter buffer 607 is a buffer forholding the K parameter to be used when encoding the next wavelettransform coefficient n, and holding the reference K parameter used inthe K parameter updating process 606. Since the range of values whichthe K parameter can take is generally about 0 to 15, the bit range ofthe K parameter can be about four bits. Also, the number of K parametersto be held changes in accordance with a subband as described in theexplanation of the K parameter updating process 606. FIG. 13 shows thepositional relationship between the K parameter to be used in nextencoding and the past K parameter to be used in the K parameter updatingprocess of each subband, and the relationship between the numbers of Kparameters to be held. In addition, this buffer is desirably implementedby a high-speed memory such as an SRAM because accesses frequentlyoccur.

In the configuration as described above, the K parameter can be updatedby using the K parameter buffer having a relatively narrow bit range,while suppressing the increase in wavelet coefficient buffer having arelatively wide bit range. This makes it possible to reduce the codeamount when performing Golomb-Rice coding on a predictive error whilesuppressing the increase in memory cost.

[Second Embodiment]

In the aforementioned first embodiment, the predictive encoder 203performs the prediction process 603 by switching the four types ofprediction methods in accordance with each wavelet-transformed subband,thereby increasing the prediction accuracy. However, the process iscomplicated because the number of branches increases, and the waveletcoefficient buffer corresponding to the subband width of subband HL isnecessary as shown in FIG. 9. When wavelet transform is performed aplurality of times, the size of subband LL decreases, and the sizes ofother subbands increase. FIG. 7A shows an example in which wavelettransform is performed three times. Since subband LL exists in onlydecomposition level 3, so the subband width is ⅛ when compared to thewidth of an input image. By contrast, subband HL exists in each ofdecomposition levels 1 to 3, and the subband length is ⅛+ 2/8+ 4/8=⅞when compared to the width of an input image. When wavelet transform isperformed three times in the first embodiment, therefore, the number ofwavelet coefficients to be buffered in subband HL is seven times that ofsubband LL. The second embodiment reduces the branches and also reducesthe necessary buffers by simplifying this prediction process. Aprediction process of the second embodiment will be explained below.Note that features other than the prediction process are the same asthose of the first embodiment, and an explanation thereof will beomitted.

First, whether a wavelet transform coefficient currently being processedbelongs to subband LL, HL, LH, or HH is identified from the subbandattribute information in this prediction process of the secondembodiment as well.

Then, if the subband currently being processed is LL, a predictiveencoder 203 determines a predictive value p of a wavelet transformcoefficient x by using MED (Median Edge Detection) prediction as in thefirst embodiment.

On the other hand, if the subband currently being processed is otherthan LL (one of subbands HL, LH, and HH), the predictive encoder 203does not predict the wavelet transform coefficient x. That is, thepredictive value p is as follows:p=0

By the above processing, a predictive value corresponding to eachsubband can be output. FIG. 14 shows the relationship between referencecoefficients to be used in the prediction process of each subband andthe number of wavelet coefficients to be held to implement thisreference. As shown in FIG. 14, the number of necessary waveletcoefficients reduces compared to that of the first embodiment, becauseno prediction is performed for subbands HL, LH, and HH in the secondembodiment. In a K parameter updating process of the second embodiment,as in the first embodiment, the process branches in accordance withwhether the wavelet coefficient currently being processed belongs tosubband LL, thereby switching updating methods.

The above configuration can reduce the necessary buffers, and simplifythe processing because subbands other than subband LL can be processedby the same prediction process and the same K parameter updatingprocess.

[Third Embodiment]

In the abovementioned first embodiment, the methods of the k parameterupdating process are switched in accordance with whether a wavelettransform coefficient currently being processed belongs to subband LL.This is so because subband LL holds wavelet transform coefficients ofsubband width+1 in the prediction process as shown in FIG. 9, and thesymbol Sd shown in FIG. 11 can be calculated within this holding range.Accordingly, when a wavelet coefficient for generating the symbol Sdfalls within the holding range for a reason other than the K parameterupdating process, the K parameter buffer can be saved by using thesymbol Sd. In this embodiment, predictive coding and runlength codingare switched based on the states of peripheral pixels as in JPEG-LS. Bythus introducing runlength coding, the encoding efficiency furtherincreases for an image in which the continuation of the same valuefrequently occurs.

FIG. 15 shows the internal arrangement of an encoder 105 according tothe third embodiment. The encoder 105 includes an image input unit 1501,wavelet transformer 1502, mode selector 1503, predictive encoder 1504,runlength encoder 1505, and code output unit 1506. The image input unit1501 receives image data output from an image processing unit 104 foreach color component. This can be the same as that of the firstembodiment.

The wavelet transformer 1502 receives monochrome image data output fromthe image input unit 1501, and performs wavelet transform on the data.This can be the same as that of the first embodiment.

The mode selector 1503 performs mode determination which determineswhether to execute a predictive encoding mode for a wavelet transformcoefficient x of interest, or execute a runlength encoding mode startingfrom the wavelet transform coefficient x of interest, thereby performingan encoding mode selecting process. In the initial settings, runlengthRL=0 is set. If the runlength RL is other than 0 or the states ofsurrounding coefficients satisfy the runlength encoding conditions, themode selector 1503 sets the encoding mode to the runlength encodingmode, and causes the runlength encoder 1505 to perform encoding. If theabovementioned conditions are not met, the mode selector 1503 selectsthe predictive encoding mode, and causes the predictive encoder 1504 toperform predictive encoding.

More specifically, as shown in FIG. 8, the left coefficient, upper leftcoefficient, upper coefficient, and upper right coefficient arerespectively defined as a, c, b, and d with respect to the wavelettransform coefficient x of interest, and, if the following condition ismet, the mode selector 1503 selects the runlength encoding mode. Then,the mode selector 1503 causes the runlength encoder 1505 to startrunlength encoding.

Condition: “a=c and c=b and b=d”

If the mode selector 1503 selects the runlength encoding mode, therunlength encoder 1505 starts runlength encoding starting from thewavelet transform coefficient x of interest. In this case, the variableRL for counting runs is initialized to 0. Then, the runlength encoder1505 sets the wavelet transform coefficient x of interest as a startpoint, and repeats a process of setting a right adjacent coefficient asa new coefficient x of interest by increasing the variable RL by 1 aslong as the coefficient x is the same as the immediately precedingcoefficient a. However, if the coefficient x of interest is differentfrom the immediately preceding coefficient a, or if the coefficient x ofinterest is the same as the immediately preceding coefficient a andreaches the line terminal end (right end position), the runlengthencoder 1505 outputs a codeword having the value (run) of the variableRL counted to that point, and notifies the mode selector 1503 of the endof runlength encoding. Upon receiving this notification, the modeselector 1503 switches the encoding mode to encoding by the predictiveencoder 1504.

As described above, the coefficients a, b, c, and d around the wavelettransform coefficient x of interest are referred to in order to satisfythe condition for starting runlength encoding. When performing thisprocess, therefore, a memory for holding wavelet coefficients of subbandwidth+1 is necessary for each subband.

Note that the processing of the predictive encoder 1504 according to thethird embodiment can be the same as that of the first embodiment exceptfor the K parameter updating process. The K parameter updating processaccording to the third embodiment does not branch in accordance withwhether a wavelet coefficient currently being processed belongs tosubband LL as in the first embodiment, but branches in accordance withwhether the coefficient belongs to subband HL. If a wavelet transformcoefficient to be processed belongs to subband HL, the predictiveencoder 1504 performs K parameter update using Kd. This K parameterupdate is the same as the process for subbands other than subband LL inthe first embodiment. On the other hand, if the coefficient x ofinterest belongs to a subband other than subband HL, the predictiveencoder 1504 performs K parameter update using the symbol Sd.

That is, if the coefficient x of interest belongs to subband LL, LH, orHH other than subband HL, the predictive encoder 1504 estimates theaverage value of a symbol corresponding to the coefficient x of interestand the symbol of the coefficient d as a tentative symbol for asucceeding coefficient. Also, if the coefficient x of interest belongsto subband HL and a parameter used when encoding the coefficient d isnot larger by a predetermined value than a parameter used when encodingthe coefficient x of interest, the predictive encoder 1504 estimates theparameter used when encoding the coefficient x of interest as aparameter to be used when encoding the succeeding coefficient n. If thecoefficient x of interest belongs to subband HL and the parameter usedwhen encoding the symbol of the coefficient d is larger by thepredetermined value than the parameter used when encoding thecoefficient x of interest, the predictive encoder 1504 estimates a valueobtained by adding the predetermined value to the parameter used whenencoding the coefficient x of interest as the parameter to be used whenencoding the succeeding coefficient n.

The configuration as described above is adopted because waveletcoefficients of subband width+1 are held for all subbands. Therefore,the symbol Sd shown in FIG. 11 can be calculated within the waveletcoefficient holding range for subbands other than subband HL, so a Kparameter buffer is unnecessary.

The processing of the runlength encoder 1505 is the same as that ofJPEG-LS, so a detailed explanation thereof will be omitted. The codeoutput unit 1506 combines the encoded data from the predictive encoder1504 and runlength encoder 1505, and outputs the combined data to theoutput unit 106.

In the configuration as described above, the K parameter updatingprocess can be performed while suppressing the increase in memory costeven in the encoding process in which runlength coding and predictivecoding are introduced.

In the first embodiment, as shown in FIG. 2, the wavelet coefficienthaving undergone wavelet transform is directly supplied to thepredictive encoder 203. Therefore, lossless coding can be implemented byusing a 5/3 filter as a filter to be used in wavelet transform, butlossy coding may also be used by performing quantization in order tofurther increase the compression ratio. In this case, a waveletcoefficient having undergone wavelet transform is quantized, and thequantized coefficient is input to predictive coding.

It is also possible to switch predictive coding and runlength codingbased on the states of surrounding pixels as in the third embodiment. Itis effective to perform abovementioned quantization because acoefficient as an encoding target readily takes consecutive values.

Furthermore, in the first to third embodiments, if the waveletcoefficient for generating the symbol Sd falls outside the holdingrange, K parameter update using the K parameter buffer is performedinstead. To further reduce the memory cost, the K parameter buffer isnot used, and the process of step S1207 shown in FIG. 12 is notperformed.

In addition, a camera is taken as an example of the apparatusincorporating the image encoding apparatus in each embodiment, but thecamera is merely a typical example of the apparatus for encoding imagedata. An input source of image data as an encoding target is not limitedto the imaging unit, and may also be a storage medium storing the imagedata as a file, so the input source is not particularly limited.

The encoded data generated by the image encoding apparatus described inthe embodiment can be converted into an image data before encoding byusing a conventional decoding method. In response to receiving theencoded data, a decoding apparatus performs prediction decoding, inversequantizing, and inverse wavelet transforming to restore the image beforeencoding.

Other Embodiments

Embodiment(s) of the present invention can also be realized by acomputer of a system or apparatus that reads out and executes computerexecutable instructions (e.g., one or more programs) recorded on astorage medium (which may also be referred to more fully as a‘non-transitory computer-readable storage medium’) to perform thefunctions of one or more of the above-described embodiment(s) and/orthat includes one or more circuits (e.g., application specificintegrated circuit (ASIC)) for performing the functions of one or moreof the above-described embodiment(s), and by a method performed by thecomputer of the system or apparatus by, for example, reading out andexecuting the computer executable instructions from the storage mediumto perform the functions of one or more of the above-describedembodiment(s) and/or controlling the one or more circuits to perform thefunctions of one or more of the above-described embodiment(s). Thecomputer may comprise one or more processors (e.g., central processingunit (CPU), micro processing unit (MPU)) and may include a network ofseparate computers or separate processors to read out and execute thecomputer executable instructions. The computer executable instructionsmay be provided to the computer, for example, from a network or thestorage medium. The storage medium may include, for example, one or moreof a hard disk, a random-access memory (RAM), a read only memory (ROM),a storage of distributed computing systems, an optical disk (such as acompact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™),a flash memory device, a memory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2015-092369, filed Apr. 28, 2015, which is hereby incorporated byreference wherein in its entirety.

What is claimed is:
 1. An image encoding apparatus for encoding imagedata, the image encoding apparatus comprising: a memory storinginstructions; a processor configured to implement the instructionsstored in the memory and execute: a transforming task that performswavelet transform on image data as an encoding target, and generatecoefficients of a plurality of subbands; and a predictive encoding taskthat performs predictive coding on the coefficients in a raster scanorder for each of the subbands obtained by the transforming task byperforming: a symbol generating task that obtains a predictive valuecorresponding to a coefficient of interest in a subband of interest froma coefficient in a completely encoded position around the coefficient ofinterest, and generates a symbol as an encoding target from a predictiveerror as a difference between a value of the coefficient of interest andthe predictive value; an encoding task that performs entropy coding onthe generated symbol using a parameter determined in a process ofencoding an immediately preceding coefficient of the coefficient ofinterest; an estimation task that estimates a tentative symbolcorresponding to a succeeding coefficient to be encoded next to thecoefficient of interest, based on a symbol corresponding to thecoefficient of interest; and a determination task that determines aparameter for the succeeding coefficient from a code length obtainedwhen assuming that the tentative symbol estimated by the estimation taskis encoded by a parameter used when encoding the symbol of thecoefficient of interest.
 2. The apparatus according to claim 1, whereinthe encoding task performs Golomb-Rice encoding, and the parameter is aK parameter to be used when performing the Golomb-Rice encoding.
 3. Theapparatus according to claim 1, wherein the estimation task: determineswhether the coefficient of interest belongs to subband LL or one ofsubband HL, subband LH, or subband HH; estimates, when the coefficientof interest belongs to the subband LL, an average value of a symbol ofthe coefficient of interest and a symbol of a coefficient that exists ona line immediately preceding a line of interest on which the coefficientof interest is positioned and exists in the same position as that of thesucceeding coefficient on the line of interest, as a tentative symbolfor the succeeding coefficient; and estimates, when the coefficient ofinterest belongs to one of the subband HL, the subband LH, or thesubband HH, the symbol of the coefficient of interest, as a tentativesymbol for the succeeding coefficient.
 4. The apparatus according toclaim 3, wherein: when a coefficient that exists on a line immediatelypreceding a line of interest on which the succeeding coefficient ispositioned and exists in the same position as that of the succeedingcoefficient on the line of interest, is defined as a first coefficient,the estimation task calculates, when the coefficient of interest belongsto the subband LL, a symbol corresponding to the first coefficient byassuming that a predictive value of the first coefficient is acoefficient immediately preceding the first coefficient.
 5. Theapparatus according to claim 3, wherein the determination task correctsthe estimated parameter by adding a predetermined value to the estimatedparameter, when the coefficient of interest belongs to one of thesubband HL, the subband LH, or the subband HH, and when a parameterobtained when encoding a symbol of a coefficient that exists on a lineimmediately preceding a line of interest on which the coefficient ofinterest is positioned and exists in the same position as that of thesucceeding coefficient on the line of interest is larger by thepredetermined value than the estimated parameter.
 6. The apparatusaccording to claim 1, wherein the processor is configured to furtherexecute: a runlength encoding task that counts runs when a coefficientof interest is the same as an immediately preceding coefficient, andoutputs a codeword of the counted runs when the coefficient of interestand the immediately preceding coefficient are different or thecoefficient of interest reaches a line terminal end; and a modedetermination task that determines, from a plurality of coefficients inalready encoded positions around the coefficient of interest, whether toencode the coefficient of interest by the predictive encoding task orencode the coefficient of interest by the runlength encoding task usingthe coefficient of interest as a start point of a run, wherein theestimation task: determines whether the coefficient of interest belongsto subband HL or one of subband LL, subband LH, or subband HH;estimates, when the coefficient of interest belongs to one of thesubband LL, the subband LH, the subband HH, an average value of a symbolcorresponding to the coefficient of interest and a symbol of acoefficient that is positioned on a line immediately preceding a line ofinterest on which the succeeding coefficient is positioned and exists inthe same position as that of the succeeding position on the line ofinterest, as a tentative symbol for the succeeding coefficient;estimates a parameter used when encoding the coefficient of interest asa parameter to be used when encoding the succeeding coefficient, whenthe coefficient of interest belongs to subband HL, and when a parameterused when encoding a symbol of a coefficient that is positioned on aline immediately preceding a line of interest on which the succeedingcoefficient is positioned and exists in the same position as that of thesucceeding coefficient on the line of interest is not larger by apredetermined value than the parameter used when encoding thecoefficient of interest; and estimates a value obtained by adding apredetermined value to a parameter used when encoding the coefficient ofinterest as a parameter to be used when encoding the succeedingcoefficient, when the coefficient of interest belongs to the subband HL,and when a parameter used when encoding a symbol of a coefficient thatis positioned on a line immediately preceding a line of interest onwhich the succeeding coefficient is positioned and exists in the sameposition as that of the succeeding coefficient on the line of interestis larger by the predetermined value than the parameter used whenencoding the coefficient of interest.
 7. The apparatus according toclaim 6, wherein encoded data is data encoded by JPEG-LS.
 8. Theapparatus according to claim 1, wherein the symbol generating task:obtains a predictive value of the coefficient of interest using MED(Median Edge Detection) prediction, when a subband of interest currentlybeing processed is subband LL; sets a coefficient that exists on a lineimmediately preceding a line of interest on which the coefficient ofinterest is positioned and exists in the same position as that of thecoefficient of interest on the line of interest, as a predictive valueof the coefficient of interest, when a subband currently being processedis subband HL; sets a coefficient encoded immediately before thecoefficient of interest as a predictive value, when a subband currentlybeing processed is subband LH; and sets a fixed value as a predictivevalue of the coefficient of interest, when a subband currently beingprocessed is subband HH.
 9. The apparatus according to claim 1, furthercomprising: a first buffer configured to hold a wavelet coefficient; anda second buffer configured to hold a K parameter.
 10. A non-transitorycomputer-readable storage medium storing a computer program executableby a computer to execute a method comprising the steps of: performingwavelet transform on image data as an encoding target and generatingcoefficients of a plurality of subbands; and performing predictivecoding on the coefficients in a raster scan order for each of thesubbands obtained in the transform step, wherein the predictive codingstep includes the steps of; obtaining a predictive value correspondingto a coefficient of interest in a subband of interest from a coefficientin a completely encoded position around the coefficient of interest, andgenerating a symbol as an encoding target from a predictive error as adifference between a value of the coefficient of interest and thepredictive value; performing entropy coding on the generated symbolusing a parameter determined in a process of encoding an immediatelypreceding coefficient of the coefficient of interest; estimating atentative symbol corresponding to a succeeding coefficient to be encodednext to the coefficient of interest based on a symbol corresponding tothe coefficient of interest; and determining a parameter for thesucceeding coefficient from a code length obtained when assuming thatthe tentative symbol estimated in the estimating step is encoded by aparameter used when encoding the symbol of the coefficient of interest.11. A control method of an image encoding apparatus for encoding imagedata, the control method comprising the steps of: performing wavelettransform on image data as an encoding target and generatingcoefficients of a plurality of subbands; and performing predictivecoding on the coefficients in a raster scan order for each of thesubbands obtained the transform step, wherein in the predictive codingstep includes the steps of: obtaining a predictive value correspondingto a coefficient of interest in a subband of interest from a coefficientin a completely encoded position around the coefficient of interest, andgenerating a symbol as an encoding target from a predictive error as adifference between a value of the coefficient of interest and thepredictive value; performing entropy coding on the generated symbolusing a parameter determined in a process of encoding an immediatelypreceding coefficient of the coefficient of interest; estimating atentative symbol corresponding to a succeeding coefficient to be encodednext to the coefficient of interest based on a symbol corresponding tothe coefficient of interest; and determining a parameter for thesucceeding coefficient from a code length obtained when assuming thatthe tentative symbol estimated in the estimating step is encoded by aparameter used when encoding the symbol of the coefficient of interest.